var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/show', function (req, resp, next) {
    resp.json({
        "id": 1,
        "name": "test",
        "classBean": {
            "id": 1,
            "nane": "班级1"
        }
    })
})
router.post('/login', function (req, resp, next) {
    let {
        username,
        pwd
    } = req.body;
    if (username == 'abc' && pwd == '123') {
        resp.json({
            code: '1',
            msg: '成功'
        })
    } else {
        resp.json({
            code: '0',
            msg: '失败'
        })
    }

})
router.get('/getstuData/:id', function (req, resp, next) {
    let {
        id
    } = req.params;
    resp.json({
        "id": id
    })
})

module.exports = router;